//
//  MovieCell.m
//  HuiWenMovie
//
//  Created by ios on 15/7/20.
//  Copyright (c) 2015年 ios. All rights reserved.
//

#import "MovieCell.h"
#import "UIImageView+WebCache.h"

@implementation MovieCell

- (void)setModel:(MovieModel *)model
{
    _model = model;
    [self setNeedsLayout];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLabel.text = self.model.title;
    self.yearLabel.text = self.model.year;
    self.averageLabel.text = [NSString stringWithFormat:@"%0.1f",self.model.average];
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:[self.model.images valueForKey:@"medium"]]];
    self.starView.average = self.model.average;

}

- (float)getPoint:(float)point
{
    int i = point;
    
    return (point - (float)i+(float)i/2);

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
